export function debounce(fn, duration) {
    let timer = null;
    return function () {
        clearTimeout(timer);
        timer = setTimeout(() => {
            fn();
        }, duration)
    }
}